﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Core.BusinessLogic.Interfaces;
using Core.DataAccess;
using Core.DataAccess.IRepositories;
using Core.Common;

namespace Core.BusinessLogic
{
    [Export(typeof(IRatingService))]
    public class RatingService : IRatingService
    {
        [Import]
        private IRatingRepository _repository;

        public RatingService()
        {
            MEFManager.Compose(this);
        }

        public bool SaveRating(Rating rating)
        {
           return _repository.SaveRating(rating);
        }


        public bool HasRateBefore(int systemObjectID, long systemObjectRecordID, int accountID)
        {
            return _repository.HasRateBefore(systemObjectID, systemObjectRecordID, accountID);
        }


        public int[] TotalLikeNumber(int systemObjectID, long systemObjectRecordID)
        {
            return _repository.TotalLikeNumber(systemObjectID, systemObjectRecordID);
        }
    }
}
